import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

/**
 * @author gao
 * @date 2025/9/6 15:39
 */

public class TestDemo {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int[] array = new int[n];
            disOrder(array);
            System.out.println("排序前：" + Arrays.toString(array));
            Sort sort = new Sort();
            sort.insertSort(array);
            System.out.println("排序后：" + Arrays.toString(array));
        }
    }
    public static void disOrder(int[] array) {
        Random ran = new Random();
        for (int i = 0; i < array.length; i++) {
            array[i] = ran.nextInt(100);
        }
    }
}